import { unitPageList } from "@/common/api/job/bill.js"

// 定位工具
export function city_location(){
	let visitSign = '';
	let _this = this;
	
	uni.getLocation({
	  type: "gcj02",
	  geocode: true,
	  success: function (res) {
		  visitSign = 
		  res.address.city 
		  +res.address.district
		  +res.address.street
		  +res.address.streetNum
		  +res.address.poiName;
	  },
	});
	return visitSign;
}

export function UnitPage(data){
	let dataSorce = '';
	unitPageList().then(res => {
		if(res.code == 200){
			// let mapvalue = new Map();
			// res.data.records.forEach(item => {
			// 	let unitGroupId = item.unitGroupId
			// 	if(unitGroupId && !item.isMainUnit){
			// 		let unitGroupList = mapvalue.get(unitGroupId)
			// 		if(!unitGroupList){
			// 			unitGroupList = [];
			// 			mapvalue.set(unitGroupId,unitGroupList);
			// 		}
			// 		unitGroupList.push(item);
			// 	}
			// })
			// uni.setStorageSync('',mapvalue);
			uni.setStorage({
			    key: 'unitGroupMap',
			    data: res.data.records,
			    success: function () {
			        console.log('success');
			    }
			});
			
		}
	})
}



